package com.ynet.middleground.approve.bean;

import java.util.List;
import java.util.Map;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;

import com.ynet.core.common.BaseReqObj;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author liulx
 * @description 完成任务请求类
 * @date 2019-10-24 11:24
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "完成任务请求对象", description = "完成任务（审核）请求对象")
public class CompleteTaskReq extends BaseReqObj {

    private static final long serialVersionUID = -2862363439850459435L;

    @ApiModelProperty(value = "可以处理该流程实例的渠道标志，若传多个，用英文逗号隔开，例：C01,C02;",
        notes = "可以处理该流程实例的渠道标志，若传多个，用英文逗号隔开，例：C01,C02;", dataType = "String")
    private String flowCanOperateChannelSignal;

    @ApiModelProperty(value = "任务ID", notes = "任务ID", required = true, dataType = "String")
    @NotBlank(message = "任务ID不能为空")
    private String taskId;

    @ApiModelProperty(value = "审批人", notes = "审批人", required = true, dataType = "String")
    @NotBlank(message = "审批人不能为空")
    private String assignee;

    @ApiModelProperty(value = "备注", notes = "备注", dataType = "String")
    private String comment;

    @ApiModelProperty(value = "下一节点审批人，该字段可以明确指定下一个审批节点处理人", notes = "下一节点审批人", dataType = "String")
    private String nextAssignee;

    /**
     * 审批结果是否通过审核
     * <p>
     * 0: 发起申请, 1: 同意, 2: 驳回（退到上一任务）, 3: 退回（退到发起人）, 4: 拒绝（用于会签投票）, 5: 撤销申请
     * </p>
     */
    @ApiModelProperty(
        value = "审批结果，是否通过审核，该字段仅用于记录任务操作人的意图\n 0: 发起申请,\n 1: 同意,\n 2: 驳回（退到上一任务）,\n"
            + " 3: 退回（退到发起人）,\n 4: 拒绝（用于会签投票）,\n 5: 撤销申请,\n 6: 跳转,\n 7:驳回至发起人, \n 8:转办, \n 9:驳回修改, \n 10:不同意;",
        notes = "审批结果，是否通过审核，该字段仅用于记录任务操作人的意图\n 0: 发起申请,\n 1: 同意,\n 2: 驳回（退到上一任务）,\n"
            + " 3: 退回（退到发起人）,\n 4: 拒绝（用于会签投票）,\n 5: 撤销申请,\n 6: 跳转,\n 7:驳回至发起人, \n 8:转办, \n 9:驳回修改, \n 10:不同意;",
        required = true, dataType = "int")
    private int approveResult = 1;

    @ApiModelProperty(value = "任务自定义参数\n可记录仅和当前任务相关的数据", notes = "任务自定义参数", dataType = "java.util.Map")
    private Map<String, Object> variables;

    @ApiModelProperty(value = "流程自定义参数\n可存放业务信息，以及流程模板配置参数信息，同名参数，会覆盖之前的数据", notes = "流程自定义参数",
        dataType = "java.util.Map")
    private Map<String, Object> processVariables;

    @ApiModelProperty(value = "业务数据", notes = "业务数据")
    private List<BusinessModuleData> businessData;

    @ApiModelProperty(value = "流程摘要", notes = "流程摘要", dataType = "String")
    private String processRemark;

    @ApiModelProperty(value = "金控经办人员Id", notes = "金控经办人员Id", dataType = "String")
    private String jinKongHandling;

    @ApiModelProperty(value = "业务场景", notes = "业务场景", dataType = "String")
    private String businessScene;

    @ApiModelProperty(value = "公司名称", notes = "公司名称", dataType = "String")
    private String companyName;

    @ApiModelProperty(value = "产品名称", notes = "产品名称", dataType = "String")
    private String productName;

    @ApiModelProperty(value = "审批意见附件信息列表,必须先填写commnet备注，否则不生效", notes = "审批意见附件信息列表,必须先填写commnet备注，否则不生效")
    @Valid
    private List<CommentFile> commentFiles;
}
